package com.study.order.fillhandle;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.study.order.entity.Salary;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author caoqianhuan
 * @date 2022/8/23
 * @Description:
 */
@Component
public class CreateTimeFillHandle implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {
        this.strictInsertFill(metaObject,"createTime",LocalDateTime::now, LocalDateTime.class);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        insertFill(metaObject);
    }
}
